package models

import "time"

// AdminTransferRecord 管理员转账记录表
type AdminTransferRecord struct {
	ID                uint              `gorm:"primarykey" json:"id"`
	AdminID           int64             `gorm:"not null;index" json:"admin_id"`
	Platform          string            `gorm:"type:varchar(50);not null" json:"platform"`
	PlatformAccount   string            `gorm:"type:varchar(50);not null" json:"platform_account"`
	TransferAmount    float64           `gorm:"type:decimal(20,2);not null" json:"transfer_amount"`
	Currency          string            `gorm:"type:varchar(10);not null" json:"currency"`
	TransferType      string            `gorm:"type:varchar(20);not null" json:"transfer_type"`
	Status            string            `gorm:"type:varchar(20);not null" json:"status"`
	TransactionID     string            `gorm:"type:varchar(50)" json:"transaction_id"`
	Remark            string            `gorm:"type:varchar(255)" json:"remark"`
	ErrorMessage      string            `gorm:"type:varchar(255);column:error_message" json:"error_message"`
	CreatedAt         time.Time         `json:"created_at"`
	UpdatedAt         time.Time         `json:"updated_at"`
	Admin             User              `gorm:"foreignKey:AdminID" json:"admin"`
	UserMatrixAccount UserMatrixAccount `gorm:"foreignKey:PlatformAccount;references:MatrixAccount" json:"user_matrix_account"`
}

// TableName 指定表名
func (AdminTransferRecord) TableName() string {
	return "admin_transfer_records"
}
